package cn.com.zero.common.auth.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;

/**
 * @author xiongxj
 * @version 1.0.0
 * @Description 用户登录认证配置properties信息
 * @createTime 2023/3/27 14:59
 */
@Configuration
@Validated
@ConfigurationProperties(prefix = AuthProperties.AUTH_PROPERTIES_PREFIX, ignoreUnknownFields = false)
public class AuthProperties {

    final static String AUTH_PROPERTIES_PREFIX = "zero.auth";

    /**
     * 允许的用户名或密码错误的次数，达到此次数，用户将被锁定
     */
    @NotNull
    private Integer permitFailedTimes;

    /**
     * 用户自动解锁时间，单位分钟
     */
    @NotNull
    private Integer autoUnlockUserTime;

    public Integer getPermitFailedTimes() {
        return permitFailedTimes;
    }

    public void setPermitFailedTimes(Integer permitFailedTimes) {
        this.permitFailedTimes = permitFailedTimes;
    }

    public Integer getAutoUnlockUserTime() {
        return autoUnlockUserTime;
    }

    public void setAutoUnlockUserTime(Integer autoUnlockUserTime) {
        this.autoUnlockUserTime = autoUnlockUserTime;
    }
}
